home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / FROMUTS / DDEPASCAL / DDE / !PC / h / xferrecv < prev    next >
Text File  |  1992-02-10  |  5KB  |  129 lines

  1. (* Title:   xferrecv.h
  2.  * Purpose: general purpose import of data by dragging icon
  3.  *
  4.  *)
  5.  
  6. #ifndef __xferrecv_h
  7. #define __xferrecv_h
  8.  
  9.  
  10. (* -------------------------- xferrecv_checkinsert -------------------------
  11.  * Description:   Set up the acknowledge message for a MDATAOPEN or MDATALOAD
  12.  *                and get filename to load from.
  13.  *
  14.  * Parameters:    char **filename -- returned pointer to filename
  15.  * Returns:       the file's type (eg. 0x0fff for !Edit)
  16.  * Other Info:    This function checks to see if the last wimp event was a 
  17.  *                request to import a file. If so it returns file type and
  18.  *                a pointer to file's name is put into *filename. If not
  19.  *                it returns -1.   
  20.  *
  21.  *)
  22. function xferrecv_checkinsert(var filename : string) : integer; extern;
  23.  
  24.  
  25. (* --------------------------- xferrecv_insertfileok -----------------------
  26.  * Description:   Deletes scrap file (if used for transfer), and sends
  27.  *                acknowledgement of MDATALOAD message.
  28.  *
  29.  * Parameters:    void
  30.  * Returns:       void.
  31.  * Other Info:    none.
  32.  *
  33.  *)
  34. procedure xferrecv_insertfileok; extern;
  35.  
  36.  
  37. (* --------------------------- xferrecv_checkprint -------------------------
  38.  * Description:   Set up acknowledge message to a MPrintTypeOdd message
  39.  *                and get file name to print.
  40.  *
  41.  * Parameters:    char **filename -- returned pointer to filename
  42.  * Returns:       The file's type (eg. 0x0fff for !Edit).
  43.  * Other Info:    Application can either print file directly or convert it to
  44.  *                <Printer$Temp> for printing by the printer application.
  45.  *
  46.  *)
  47. function xferrecv_checkprint(var filename : string) : integer; extern;
  48.  
  49.  
  50. (* --------------------------- xferrecv_printfileok ------------------------
  51.  * Description:   Send an acknowledgement back to printer application. If
  52.  *                file sent to <Printer$Temp> then this also fills in file
  53.  *                type in message.
  54.  *
  55.  * Parameters:    int type -- type of file sent to <Printer$Temp> 
  56.  *                            (eg. 0x0fff for !edit)
  57.  * Returns:       void.
  58.  * Other Info:    none.
  59.  *
  60.  *)
  61. procedure xferrecv_printfileok(_type : integer); extern;
  62.  
  63.  
  64. (* ---------------------------- xferrecv_checkimport -----------------------
  65.  * Description:   Set up acknowledgement message to a MDATASAVE message.
  66.  *
  67.  * Parameters:    int *estsize -- sender's estimate of file size
  68.  * Returns:       File type.
  69.  * Other Info:    none.
  70.  *
  71.  *)
  72. function xferrecv_checkimport(var estsize : integer) : integer; extern;
  73.  
  74.  
  75. (* ------------------------- xferrecv_buffer_processor ---------------------
  76.  * Description:   This is a typedef for the caller-supplied function
  77.  *                to empty a full buffer during data transfer.
  78.  *
  79.  * Parameters:    char **buffer -- new buffer to be used
  80.  *                int *size -- updated size
  81.  * Returns:       return FALSE if unable to empty buffer or create new one.
  82.  * Other Info:    This is the function (supplied by application,) which will
  83.  *                be called when buffer is full. It should empty the current
  84.  *                buffer, or create more space and modify size accordingly
  85.  *                or return FALSE. *buffer and *size are the current buffer
  86.  *                and its size on function entry.
  87.  *
  88.  *)
  89. type xferrecv_buffer_processor = ^function buffer_processor(
  90.                                         var buffer : pointer;
  91.                                         var size : integer) : boolean;
  92.  
  93.  
  94.  
  95. (* ---------------------------- xferrecv_doimport --------------------------
  96.  * Description:   Loads data into a buffer, and calls the caller-supplied
  97.  *                function to empty the buffer when full.
  98.  *
  99.  * Parameters:    char *buf -- the buffer
  100.  *                int size -- buffer's size
  101.  *                xferrecv_buffer_processor -- caller-supplied function to
  102.  *                                             be called when buffer full
  103.  * Returns:       Number of bytes transferred on successful completion
  104.  *                or -1 otherwise.
  105.  * Other Info:    none.
  106.  *
  107.  *)
  108. function xferrecv_doimport(buf : pointer;
  109.                 size : integer;
  110.                 p : xferrecv_buffer_processor) : integer; extern;
  111.  
  112.  
  113.  
  114. (* ---------------------- xferrecv_file_is_safe ----------------------------
  115.  * Description:   Informs caller if file was recieved from a "safe" source
  116.  *                (see below for definition of "safe").
  117.  *
  118.  * Parameters:    void
  119.  * Returns:       true if file is safe.
  120.  * Other Info:    "Safe" in this context means that the supplied filename
  121.  *                will not change in the foreseeable future.
  122.  *
  123.  *)
  124. function xferrecv_file_is_safe : boolean; extern;
  125.  
  126. #endif
  127.  
  128. (* end xferrecv.h *)
  129.